Skip to content

Conversation

@kraenhansen
Copy link
Contributor

@kraenhansen kraenhansen commented Oct 13, 2025

Description

Merging this PR will:

  • Check for an existing branch.
  • Perform a sparse checkout of the package-lock.json of any existing branch.
  • Only create the PR (or force-push) if the branch doesn't already exist or the package-lock.json differs after the upgrade has been applied.

Checklist

  • New tests and/or benchmarks are included
  • Documentation is changed or added
  • If this change updates the UI, screenshots/videos are added and a design review is requested
  • I have signed the MongoDB Contributor License Agreement (https://www.mongodb.com/legal/contributor-agreement)

Motivation and Context

  • Bugfix
  • New feature
  • Dependency update
  • Misc

See peter-evans/create-pull-request#3977 and section in the action's README.md for a bit more context on the lack of this feature in the "create-pull-request" action.

Open Questions

Dependents

Types of changes

  • Backport Needed
  • Patch (non-breaking change which fixes an issue)
  • Minor (non-breaking change which adds functionality)
  • Major (fix or feature that would cause existing functionality to change)

@kraenhansen kraenhansen self-assigned this Oct 13, 2025
@kraenhansen kraenhansen added the no release notes Fix or feature not for release notes label Oct 13, 2025
uses: actions/checkout@v4
with:
ref: ${{ env.UPDATE_BRANCH_NAME }}
path: existing-branch-checkout
Copy link
Collaborator

@gribnoysup gribnoysup Oct 13, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A bit hard to validate until we actually manage to make this task update an exiting PR, but just reading through this change seems like this checked out file will continue to be there if the PR is being created updated and I think the create-pull-request will commit it with other files. We probably want to clean it up before this happens?

Copy link
Contributor Author

@kraenhansen kraenhansen Oct 13, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good catch. Perhaps we should just add it to the .gitignore?

@kraenhansen
Copy link
Contributor Author

Dispatched this manually on "eslint", which at the time of running already had a PR open and it did seem to skip the create-pull-request action as expected.

@kraenhansen kraenhansen marked this pull request as ready for review October 13, 2025 12:11
@kraenhansen kraenhansen requested a review from a team as a code owner October 13, 2025 12:11
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR improves the CI dependency update workflow to avoid unnecessary force pushes by checking for existing branches and comparing package-lock.json files before creating or updating pull requests.

  • Adds branch existence checking to prevent overwriting manual commits on update branches
  • Implements sparse checkout of existing branches to compare package-lock.json changes
  • Makes PR creation conditional based on branch existence and actual file differences

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

@kraenhansen kraenhansen force-pushed the kh/update-dependencies-without-force-push branch 2 times, most recently from 7c5c5bf to 2b7626f Compare October 17, 2025 12:20
@kraenhansen kraenhansen force-pushed the kh/update-dependencies-without-force-push branch from 2b7626f to 1977c6d Compare October 28, 2025 07:29
@kraenhansen kraenhansen merged commit a8086e3 into main Oct 28, 2025
61 checks passed
@kraenhansen kraenhansen deleted the kh/update-dependencies-without-force-push branch October 28, 2025 15:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

no release notes Fix or feature not for release notes

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants